home *** CD-ROM | disk | FTP | other *** search
- #ifndef STRATEGIES_H
- #define STRATEGIES_H
-
-
- #include "Board.h"
- #include "Rules.h"
- //#include "Arnold.h"
-
- #ifndef THINK_C
- #include <Types.h>
- #endif
-
-
- // A strategy should be a BoardJudgeProc or a MoveJudgeProc.
- // Optionally, a PruneJudgeProc pruning function can be added.
- // See source file Strategies.c for a more elaborate comment.
-
- typedef short (*BoardJudgeProc) (BoardPtr, short);
- typedef short (*MoveJudgeProc) (BoardPtr, short, MovePtr);
- typedef Boolean (*PruneJudgeProc) (short, short, short);
-
-
-
- // You can join the internal competition in this program by implementing this
-
- short TheFinalStrategy (BoardPtr board, short player); // your BoardJudgeProc ?
-
- // As an option, you can add this
-
- Boolean TheFinalGardener (short, short, short); // your PruneJudgeProc ?
-
-
-
- enum _findfunction // Toggle for union below
- {
- boardMiniMax, // boardProc member will be used
- boardMiniMaxNoFliche, // boardProc member will be used
- boardMiniMaxGreedy, // boardProc member will be used
- moveMiniMax // moveProc member will be used
- };
-
-
- typedef struct _strat { // This struct describes a strategy
-
- enum _findfunction Type;
-
- union // Choise depends on toggle above
- {
- BoardJudgeProc boardProc;
- MoveJudgeProc moveProc;
-
- } JudgeProc;
-
- PruneJudgeProc PruneProc;
-
- // The first few moves, resursion won't help much:
- // the enemy is still out of reach (and so are you for the enemy),
- // so a purely postional strategy can be used.
- // Thus, the first few moves can usually be made with a recursion level of 0.
- // This can win some valuable seconds.
- // Think of this as of having an 'opening library'
-
- short FastOpen;
- #define kDefaultFast 1
-
- unsigned char Name [32];
-
- } StrategyStruct;
-
-
- extern StrategyStruct gStrategies[];
-
-
- // These are some strategies I implemented so far
-
- short Paul (BoardPtr board, short player); // a sample BoardJudgeProc
- short Ross (BoardPtr board, short player); // a BoardJudgeProc
- short Bill (BoardPtr board, short player, MovePtr move); // a MoveJudgeProc
- extern
- short Arnold (BoardPtr board, short player); // a BoardJudgeProc
- extern
- short Frankie (BoardPtr board, short player); // a BoardJudgeProc
- short Peter (BoardPtr board, short player); // a BoardJudgeProc
-
- // These are the pruning functions
-
- Boolean Sarah (short, short, short); // a PruneJudgeProc
-
- #endif
-
-
- #ifdef STRATEGIES_C
-
- #include "Game.h"
- #include "Global.h"
-
- #include <Events.h>
- #include <StdLib.h>
-
- #endif
-
-